package com.example.consumer;

import com.example.common.model.User;
import com.example.common.service.UserService;
import com.example.easyrpc.proxy.ServiceProxyFactory;

public class EasyConsumer {

    public static void main(String[] args) {
        // 希望通过RPC框架来实现注入
        // 动态代理获取
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("ydy");

        User newUser = userService.getUser(user);
        if(newUser != null){
            System.out.println(newUser.getName());
        }else{
            System.out.println("newUser is null");
        }
    }

}
